import request from '@/config/axios'

// 工厂信息 VO
export interface FactoryInfoVO {
  id: number // 编号
  factoryCode: string // 工厂编码
  floorCode: string // 楼层编码
  areaCode: string // 区域编码
  lineCode: string // 产线编码
}

// 工厂信息 API
export const FactoryInfoApi = {
  // 查询工厂信息分页
  getFactoryInfoPage: async (params: any) => {
    return await request.get({ url: `/opticore/factory-info/page`, params })
  },

  // 查询工厂信息详情
  getFactoryInfo: async (id: number) => {
    return await request.get({ url: `/opticore/factory-info/get?id=` + id })
  },

  // 新增工厂信息
  createFactoryInfo: async (data: FactoryInfoVO) => {
    return await request.post({ url: `/opticore/factory-info/create`, data })
  },

  // 修改工厂信息
  updateFactoryInfo: async (data: FactoryInfoVO) => {
    return await request.put({ url: `/opticore/factory-info/update`, data })
  },

  // 删除工厂信息
  deleteFactoryInfo: async (id: number) => {
    return await request.delete({ url: `/opticore/factory-info/delete?id=` + id })
  },

  // 导出工厂信息 Excel
  exportFactoryInfo: async (params) => {
    return await request.download({ url: `/opticore/factory-info/export-excel`, params })
  },
}